package com.common.converter;

import com.common.entity.target.TargetItemAssignEntity;
import com.common.entity.target.TargetItemEntity;
import com.common.requestvo.target.TargetItemAssignReqVo;
import com.common.requestvo.target.TargetItemReqVo;
import com.common.vo.target.TargetItemAssignVo;
import com.common.vo.target.TargetItemVo;
import org.mapstruct.Mapper;
import org.mapstruct.Mapping;
import org.mapstruct.Mappings;
import org.mapstruct.factory.Mappers;

/**
 * @author johnny
 * @create 2020-07-13 下午5:04
 **/
@Mapper
public interface TargetItemAssignConverter {

    TargetItemAssignConverter INSTANCE = Mappers.getMapper(TargetItemAssignConverter.class);


    @Mappings({
            @Mapping(source = "createTime", target = "createTime", dateFormat = "yyyy-MM-dd HH:mm:ss"),
            @Mapping(source = "updateTime", target = "updateTime", dateFormat = "yyyy-MM-dd HH:mm:ss"),
    })
    TargetItemAssignVo domain2vo(TargetItemAssignEntity targetItemAssignEntity);

    @Mappings({
            @Mapping(source = "createTime", target = "createTime", dateFormat = "yyyy-MM-dd HH:mm:ss"),
            @Mapping(source = "updateTime", target = "updateTime", dateFormat = "yyyy-MM-dd HH:mm:ss"),
    })
    TargetItemAssignEntity vo2domain(TargetItemAssignReqVo targetItemAssignReqVo);
}